package com.wsjj.yjh.server.impl;

import com.wsjj.yjh.bean.HadoopTable;
import com.wsjj.yjh.bean.LinuxShellTable;
import com.wsjj.yjh.mapper.HadoopTableMapper;
import com.wsjj.yjh.server.HadoopTableServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class HadoopTableServerImpl implements HadoopTableServer {

    @Autowired
    private HadoopTableMapper hadoopTableMapper;

    @Override
    public HadoopTable selectById() {
        Integer coumt = hadoopTableMapper.selectCoumt();

        Random random = new Random();
        int id = random.nextInt(coumt);

        return hadoopTableMapper.selectById(id+1);
    }
}
